<%--
  Created by IntelliJ IDEA.
  User: adaptercat
  Date: 17-6-13
  Time: 下午5:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <script type="text/javascript" src="js/jquery-3.2.1.js"></script>
    <script src="/js/test.js"></script>
    <title>demo</title>
</head>
<body>

<script type="text/javascript">
    function seed() {
        var json = {"action": "seed"};
        $.ajax({
            type: "post", //请求方式
            url: "servlet/seed", //发送请求地址
            data: JSON.stringify(json), //发送给数据库的数据
            dataType: "json",
            //发送前
            beforeSend: function () {
            },
            //发送后
            success: function (data) {
                alert(data.name);

            }
        });
    }
</script>
<input type="button" onclick="seed()" value="click"/>
</body>
</html>
